<?php 
class Usersession_model  extends CI_Model {

	function __construct(){
        parent::__construct();
        $this->load->library('session');
    }
    
	public function setUser($user){
		$this->session->unset_userdata('user');
    	$this->session->set_userdata('user', $user);
    }
    
	public function getUser(){
    	return $this->session->userdata('user');
    }
    
    public function destroy(){
    	$this->session->sess_destroy();
    }
}